package com.cookie.framework.utils;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.animation.LinearInterpolator;

/**
 * 项目名:    MeetProject
 * 包名:      com.cookie.framework.utils
 * 文件名:    AnimUtils
 * 创建者:    cookie
 * 创建时间:   2019/12/31 22:25
 * 描述:      动画工具类
 */

public class AnimUtils {

    //旋转动画
    public static ObjectAnimator rotation(View view) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
        objectAnimator.setDuration(6 * 1000);
        objectAnimator.setRepeatMode(ValueAnimator.RESTART);
        objectAnimator.setRepeatCount(ValueAnimator.INFINITE);
        objectAnimator.setInterpolator(new LinearInterpolator());
        return objectAnimator;
    }
}
